<%@ include file="public/include.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 	<link type="text/css" rel="stylesheet" href="styles/pub/default.css">
	<script type="text/javascript" language="JavaScript" src="scripts/pub/jquery.js"></script>
	<script type="text/javascript" language="JavaScript" src="scripts/pub/common.js"></script>
	<script type="text/javascript" language="JavaScript" src="scripts/biz/apply.js"></script>
	<script type="text/javascript" language="JavaScript" src="scripts/biz/export.js"></script>
</head>
<body>
<c:set value="${map.apply}" var="apply" />
<c:set value="${map.censor1}" var="censor1" />
<c:set value="${map.censor2}" var="censor2" />
<div class="main" align="center">
<form action="ApplyCensorSubmit.do" method="post">
	<table style="width:90%;" align="center">
		<%@ include file="/ApplyInfoView.jsp"%>
		
		<c:choose>
			<c:when test="${map.opt=='view'}">
				<%@ include file="/ApplyCensorView.jsp" %>
			</c:when>
			<c:otherwise>
				<%@ include file="/ApplyCensorHandle.jsp" %>
			</c:otherwise>
		</c:choose>

		<tr class="button">
		  <td align="center">
		  	<div>
		  		<input type="hidden" name="applyId" value="${apply.id}">
		  		<c:if test="${(apply.applyFlag==1&&myfunc:containAny('ROLE_APPLY_CENSOR',map.currentUser.authorityNames))||(apply.applyFlag==4&&myfunc:containAny('ROLE_APPLY_AUDIT',map.currentUser.authorityNames))}">
		  			<c:choose>
						<c:when test="${map.opt=='view'}">
						</c:when>
					<c:otherwise>
						<input type="button" value=" 提交 " onclick=confirmSubmit('validateApplyCensor()') />
					</c:otherwise>
				</c:choose>
		  		</c:if>
		  		<c:if test="${map.opt=='view'}">
			  		<div style="visibility:hidden;display:none;">
						<script type="text/javascript">
							function exportRun(){
								var apply=${map.applyJson}.apply;
								var censor1=${map.censor1Json}.censor1;
								var censor2=${map.censor2Json}.censor2;
								var exhPorpers=['<mytag:checkbox type="exhProp" values="${apply.exhProp}"/>',
									'<mytag:checkbox type="trePlan" values="${apply.trePlan}"/>',
									'<mytag:checkbox type="itemSort" values="${apply.itemSort}"/>',
									'<mytag:checkbox type="sheetType" values="${apply.sheetType}"/>'];
								applyExportView(apply,censor1,censor2,exhPorpers);
							}
						</script>
					</div>
		  		</c:if>
				<input type="button" value=" 导出 " onclick="exportRun()" />
			    <input type="button" value=" 返回 " onClick="window.history.back();">
		  	</div>
		   </td>
		</tr>
	</table>
</form>
</div>
</body>
</html>
